package spe;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

/**
 * The activator class controls the plug-in life cycle
 */
public class Activator extends AbstractUIPlugin 
{
	public static final String IMG_METHODPLIBRARY = "MethodLibrary";
	public static final String IMG_METHODPLIBRARY_24 = "MethodLibrary24";
	public static final String IMG_METHODPLIBRARY_16 = "MethodLibrary16";
	
	public static final String IMG_METHODPLUGIN = "MethodPlugin";
	public static final String IMG_METHODPLUGIN_24 = "MethodPlugin24";
	public static final String IMG_METHODPLUGIN_16 = "MethodPlugin16";
	
	public static final String IMG_METHODCONFIG = "MethodConfig";
	public static final String IMG_METHODCONFIG_24 = "MethodConfig24";
	public static final String IMG_METHODCONFIG_16 = "MethodConfig16";
	
	public static final String IMG_METHODCONTENTPACKAGE = "MethodContentPackage";
	public static final String IMG_METHODCONTENTPACKAGE_24 = "MethodContentPackage24";
	public static final String IMG_METHODCONTENTPACKAGE_16 = "MethodContentPackage16";
	
	public static final String IMG_PROCESSPACKAGE = "ProcessPackage";
	public static final String IMG_PROCESSPACKAGE_24 = "ProcessPackage24";
	public static final String IMG_PROCESSPACKAGE_16 = "ProcessPackage16";
	
	public static final String IMG_TASKDEF = "TASKDEF";
	public static final String IMG_TASKDEF_24 = "TASKDEF24";
	public static final String IMG_TASKDEF_16 = "TASKDEF16";
	
	public static final String IMG_WORKPRODUCTDEF = "WORKPRODUCTDEF";
	public static final String IMG_WORKPRODUCTDEF_24 = "WORKPRODUCTDEF24";
	public static final String IMG_WORKPRODUCTDEF_16 = "WORKPRODUCTDEF16";
	
	public static final String IMG_ROLEDEF = "ROLEDEF";
	public static final String IMG_ROLEDEF_24 = "ROLEDEF24";
	public static final String IMG_ROLEDEF_16 = "ROLEDEF16";
	
	public static final String IMG_ACTIVITY = "ACTIVITY";
	public static final String IMG_ACTIVITY_24 = "ACTIVITY24";
	public static final String IMG_ACTIVITY_16 = "ACTIVITY16";
	
	public static final String IMG_STEP = "STEP";
	public static final String IMG_STEP_24 = "STEP24";
	public static final String IMG_STEP_16 = "STEP16";
	
	public static final String IMG_TASKUSE = "TASKUSE";
	public static final String IMG_TASKUSE_24 = "TASKUSE24";
	public static final String IMG_TASKUSE_16 = "TASKUSE16";
	
	public static final String IMG_ROLEUSE = "ROLEUSE";
	public static final String IMG_ROLEUSE_24 = "ROLEUSE24";
	public static final String IMG_ROLEUSE_16 = "ROLEUSE16";
	
	public static final String IMG_LINK_24 = "LINK24";
	
	public static final String IMG_PROJECT = "PROJECT";

	// The plug-in ID
	public static final String PLUGIN_ID = "spe"; //$NON-NLS-1$

	// The shared instance
	private static Activator plugin;
	
	/**
	 * The constructor
	 */
	public Activator() {
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext context) throws Exception {
		super.start(context);
		plugin = this;
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext context) throws Exception {
		plugin = null;
		super.stop(context);
	}
	
	public Image getImage(String imageID)
	{
		return (plugin.getImageRegistry()).get(imageID);
	}

	/**
	 * Returns the shared instance
	 *
	 * @return the shared instance
	 */
	public static Activator getDefault() {
		return plugin;
	}

	/**
	 * Returns an image descriptor for the image file at the given
	 * plug-in relative path
	 *
	 * @param path the path
	 * @return the image descriptor
	 */
	public static ImageDescriptor getImageDescriptor(String path) {
		return imageDescriptorFromPlugin(PLUGIN_ID, path);
	}
	
	public static ImageDescriptor getImageDescriptorByPath(String path)
	{
		return imageDescriptorFromPlugin(PLUGIN_ID, path);
	}
}
